import Router from "koa-router";
import httpRequest from "@/utils/http";
import { Result } from "@/utils/result";

const movieRouter = new Router({ prefix: "/api/daily/movie" });

movieRouter.get("/", async (ctx, next) => {
    const res = await httpRequest.get({
        baseURL: "https://api.codelife.cc/itab/todayMovie?lang=cn&version=v2"
    });
    const movie = res.data;
    Result.ok(ctx, movie, "电影获取成功");
});

export default movieRouter;
